/**
 * 统计输入数据中每个数字出现的次数、空白字符出现的次数以及其他字符出现的次
 * 数，并将统计结果输出到屏幕
 */

#include <stdio.h>

int main() {
    int c, i, nw, nothers;
    int ndigits[10];

    nw = nothers = 0;
    for (i = 0; i < 10; i++) ndigits[i] = 0;

    while ((c = getchar()) != EOF) {
        if (c == ' ' || c == '\t' || c == '\n') nw++;
        else if (c >= '0' && c <= '9') ndigits[c-'0']++;
        else nothers++;
    }

    printf("digits count: ");
    for (i = 0; i < 10; i++) printf("%d ", ndigits[i]);
    printf(", whites space: %d, other characters: %d\n", nw, nothers);

    return 0;
}
